<template>
  <div>vue生命周期</div>
  <A v-if="flag"></A>
  <a-button @click="flag = true">创建组件A</a-button>
  <a-button @click="flag = false">销毁组件A</a-button>
</template>

<script setup lang='ts'>
import { ref, reactive } from 'vue'
import A from './components/A.vue'
const flag = ref(true)
</script>
<style lang='less' scoped>

</style>